#!/usr/bin/python
#
# ChatGPT generated program to generate 1,000,000 possible passwords
#
# Prompt:
# Create a python program that will generate a list of 1,000,000 unique possible passwords. Each password to be between 4 and 15 characters long.
#   Use the words "connections", "academy", "administrator", "student", "admin", "password", "Baltimore", "Exeter", "Pearson", "bios", "school", "education", "learning", "probook", "HP", & "laptop".
#   Also use commonly used passwords, and names of sports teams in Maryland and surrounding states.
#   Also include names of geographic sites or attractions in the Maryland area.
#   Use these words in various combinations and abbreviations with combination, substitutions, numeric values, and punctuation.
#   Add numeric and punctuation characters randomly into the words and at the ends of words.
#   Make a simple downloadable text file, 1 word per line. no formatting.
#
#
#


import random
import itertools
import string

# Base words
base_words = [
    "connections", "academy", "administrator", "student", "admin", "password",
    "Baltimore", "Exeter", "Pearson", "bios", "school", "education", "learning",
    "probook", "HP", "laptop"
]

# Sports teams (Maryland + surrounding states)
sports_teams = ["ravens", "orioles", "commanders", "nationals", "capitals", "wizards", "eagles", "phillies", "flyers", "sixers", "steelers", "penguins", "pirates", "terrapins", "midshipmen", "retrievers", "tigers", "bulldogs", "bobcats", "hokies", "cavaliers", "mountaineers", "bluehens", "baysox", "bluecrabs", "nats", "flyingsquirrels", "bluerocks", "tides", "fightingphils", "shorebirds", "bayhawks", "blast", "defenders", "valor"]

# Geographic sites & attractions in Maryland
geo_sites = ["chesapeake", "assateague", "oceancity", "annapolis", "fortmchenry", "innerharbor", "aquarium", "antietam", "blackwater", "tubman", "canal", "sixflags", "strathmore", "brookside", "greatfalls", "deepcreek", "swallowfalls", "calvertcliffs", "statehouse", "navalacademy", "rockygap", "merriweather", "visionaryart", "evergreen", "patapsco", "pointlookout", "railroad", "basilica", "trimpers", "walters", "baltimoremuseum", "maritime", "sciencecenter", "zoo", "barton", "fellspoint", "camdenyards", "poehouse", "mchenry", "washingtonmonument"]

# Commonly used weak passwords
common_pw = ["123456", "password", "123456789", "qwerty", "12345678", "111111", "1234567", "12345", "1234", "dragon", "baseball", "football", "letmein", "monkey", "abc123", "sunshine", "princess", "flower", "welcome", "shadow", "master", "666666", "qwertyuiop", "123123", "mustang", "michael", "superman", "batman", "trustno1", "ninja", "iloveyou", "guest", "zaq1zaq1", "qazwsx", "123qwe", "killer", "helpme", "hockey", "password1", "soccer", "test", "pass", "jesus", "welcome1", "ginger", "enter", "fucker", "whatever", "andrew", "joshua", "hallo", "spiderman", "buster", "pepper", "12341234", "hello", "tigger", "robert", "matthew", "12345a", "liverpool", "cheese", "summer", "chelsea", "biteme", "toyota", "coffee", "george", "falcon", "helpme", "fuckyou", "hunter", "qwertz", "klaster"]

# Combine all sources
all_words = base_words + sports_teams + geo_sites + common_pw

# Character substitutions
subs = {
    "a": ["a", "@", "4"],
    "s": ["s", "$", "5"],
    "o": ["o", "0"],
    "i": ["i", "1", "!"],
    "e": ["e", "3"],
    "l": ["l", "1"],
}

# Function to apply random substitutions
def apply_subs(word):
    new_word = ""
    for ch in word:
        if ch.lower() in subs:
            new_word += random.choice(subs[ch.lower()])
        else:
            new_word += ch
    return new_word

# Generate variations
def generate_variations(word):
    variations = set()
    for _ in range(20):  # multiple tries
        w = apply_subs(word)
        # randomly add numbers/punctuation at start or end
        if random.random() > 0.5:
            w += random.choice(string.digits + string.punctuation)
        if random.random() > 0.7:
            w = random.choice(string.digits) + w
        if 4 <= len(w) <= 15:
            variations.add(w)
    return variations

# Build password set
passwords = set()

# Generate from single words
for w in all_words:
    passwords.update(generate_variations(w))

# Generate from word combinations
# Increased to 10,000,000 iterations to ensure we reach 1 million unique passwords
for _ in range(10000000):
    w1, w2 = random.sample(all_words, 2)
    combo = apply_subs(w1) + apply_subs(w2)
    if len(combo) < 15:
        if random.random() > 0.5:
            combo += str(random.randint(0, 99))
        passwords.add(combo)

# Shuffle and trim to 1,000,000 unique
passwords = list(passwords)
random.shuffle(passwords)
passwords = passwords[:1000000]

# Save to file
with open("ProBook Password List for Connection Academy (1,000,000).txt", "w", encoding="utf-8") as f:
    for pw in passwords:
        f.write(pw + "\n")

print("Generated", len(passwords), "passwords into 'ProBook Password List for Connection Academy (1,000,000).txt'")
